Replication File for Populist Discourse and Public Support for Executive Aggrandizement in Latin America

----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------

*R Scripts*

Scripts should be run in the following order:

1. cleaning_lapop_1.R
   - Loads original LAPOP data, 2004-2018 LAPOP AmericasBarometer Merge (v1.0w).dta
   - Subsets data and saves as lapop_slim.RData

2. label_winners.R
   - Loads lapop_slim.RData and GPD_20190625.csv
   - Prepares global populism data for merging with LAPOP data
   - Adds data on vb3 and vb11 codes for labelling presidential supporters
   - Creates lapop_winners.csv 

3. cleaning_lapop_2.R
   - Loads lapop_slim.RData and lapop_winners.csv
   - Codes presidential supporters using winners_lapop.csv
   - Merges in variables from DPI2020_stata13.dta and V-Dem-CY-Full+Others-v10.rds
   - Recodes LAPOP survey data
   - Saves recoded data as lapop_10_18.Rdata

4. paper_models.Rmd
   - Loads lapop_10_18.Rdata
   - Runs models 1-6, making main text Tables 1 and 2 and Figure 1
   - Runs models for Tables S4 and S5

5. supplemental_info.Rmd
   - Loads lapop_10_18.Rdata
   - Runs models supplemental information models 7 to 43, creating Tables S6 - S15
   - Makes Table S3 (correlation matrix) and Figure S1

6. iteratively_drop_countries.R
   - Loads lapop_10_18.Rdata
   - Runs models iteratively dropping countries
   - Makes supplemental info Figures S2 and S3

7. gps_gov_v_opposition.Rmd
   - Loads winners_lapop_full.csv, gps_by_party_V2_Apr_2020.xlsx, and lapop_10_18.Rdata
   - Makes supplemental info Figures S4 and S5

8.experimental_analysis.Rmd
   - Loads ecu_data.csv
   - Cleans survey data 
   - Makes main text Figures 2 and 3
   - Makes supplemental info Tables S16, S18 - S23
   - Makes supplemental info Figures S6 - S10

--------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------

*Data Files*

1. 2004-2018 LAPOP AmericasBarometer Merge (v1.0w).dta
   - Dataset from the Latin American Public Opinion Project (LAPOP)

2. lapop_slim.RData
   - LAPOP Data from 2010 to 2018 

3. winners_lapop_full.csv
  - Data from the Global Populism Database 
  - Includes variables for LAPOP survey wave (wave) and for tagging presidential supporters  (vb3code, vb11code)

4. lapop_10_18.Rdata
  - Cleaned and recoded LAPOP data, including country-level variables

5. ec_survey_2022_codebook.pdf
   - Codebook for the  Ethnicity, Inequality, Trust, and Politics in Ecuador Survey

6. ecu_data.csv
  - Select variables from the Ethnicity, Inequality, Trust, and Politics in Ecuador Survey

7. DPI2020_stata13.dta
  - Dataset from Database of Political Instituions  

8. GPD_20190625.csv 
  - Global Populism Data 

8. gps_by_party_V2_Apr_2020.xlsx
  - Dataset from from the Global Party Survey

9. V-Dem-CY-Full+Others-v10.rds
  - Dataset from Varieties of Democracy (V-Dem)


-------------------------------------------------------------------------------------------------------

*Variables in lapop_10_18.Rdata*

See the supplemental information Tables S1 and S2 for variable descriptions.

iso3c - ISO3 country code
close.cong - close congress
close.court - close court
winner - presidential supporter
non_voter - non-voter
pid_winner - incumbent partisan 
non_partisan - non-partisan
trust.people - interpersonal trust 
wealth - wealth
neigh.safe - neighborhood safe
rural - rural
dem.best - support for democracy
dem.best.tj - mass support for democracy
pop_ind - populist attitudes
sat_dem - satisfaction with democracy
edu - years education
female - female
econ.eval- economic evaluation
v2x_libdem - liberal democracy index
vdem.polar - political polarization
mass.polr - mass 
v2x_corr - government corruption
pop.speech - populist discourse
maj - legislative control


-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------

R Package Versions Used:
 
attached base packages:
[1] grid      parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] consort_1.2.0          wesanderson_0.3.6      xtable_1.8-4           performance_0.10.3    
 [5] survey_4.2-1           survival_3.4-0         dotwhisker_0.7.4       texreg_1.38.6         
 [9] glmmTMB_1.1.7          tictoc_1.2             marginaleffects_0.12.0 ggeffects_1.3.1       
[13] broom.mixed_0.2.9.4    knitr_1.43             ggpubr_0.6.0           ggsci_3.0.0           
[17] sjmisc_2.8.9           sjPlot_2.8.14          stargazer_5.2.3        interplot_0.2.3       
[21] arm_1.13-1             lme4_1.1-33            Matrix_1.5-4.1         MASS_7.3-58.1         
[25] abind_1.4-5            psych_2.3.3            conflicted_1.2.0       here_1.0.1            
[29] wbstats_1.0.4          readxl_1.4.2           reshape2_1.4.4         countrycode_1.4.0     
[33] haven_2.5.2            foreign_0.8-83         readstata13_0.10.1     lubridate_1.9.2       
[37] forcats_1.0.0          stringr_1.5.0          dplyr_1.1.2            purrr_1.0.1           
[41] tidyr_1.3.0            tibble_3.2.1           ggplot2_3.4.2          tidyverse_2.0.0       
[45] readr_2.1.4           








